package com.heima.method;

import java.util.Scanner;

public class Demo2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你要打印数字范围:最小的数");
        int sc1=sc.nextInt();
        System.out.println("请输入你要打印数字范围:最大的数");
        int sc2=sc.nextInt();
         Demo2.print(sc1,sc2);
    }

    public  static void print(int n,int m){
        System.out.println(n+"到"+m+"之间的奇数有:");
        for (int i = n; i <=m ; i++) {
            if(i%2!=0){
                System.out.println("第"+(i-n+1)+"个奇数是"+i);
            }
        }

    }
}
